<?php $this->beginContent('/layouts/main'); ?>
<div class="main-content grid_4 alpha">
    <header>
        <div class="view-switcher">
            <?php if ($this->viewModes == null): ?>
                <h2><?php echo $this->sectionTitle; ?></h2>
            <?php else: ?>
                <h2><?php echo $this->sectionTitle; ?> <a href="#">&darr;</a></h2>
                <?php
                    $this->widget('zii.widgets.CMenu', array(
                    'items' => $this->viewModes,
                ));
                ?>
            <?php endif; ?>
        </div>
    </header>
    <section>
        <?php echo $content; ?>
    </section>
</div>

<div class="preview-pane grid_3 omega">
    <div class="content">
        <h3>Preview Pane</h3>

        <p>This is the preview pane. Click on the more button on an item to view more information.</p>
    </div>
    <div class="preview">
    </div>
</div>

<?php Yii::app()->clientScript->registerScript('previewPane', '
        // preview pane
        $(".list-view > li").click(function(){
            var url = $(this).find(".more").attr("href");
            if (!$(this).hasClass("current")) {
                $(".preview-pane .preview").animate({left: "-375px"}, 300, function(){
                    $(this).animate({left: "-22px"}, 500).html("<img src=\"images/ajax-loader.gif\" />").load(url);
                });
            } else {
                $(".preview-pane .preview").animate({left: "-375px"}, 300);
            }
            $(this).toggleClass("current").siblings().removeClass("current");
            return false;
        });

        $(".preview-pane .preview .close").live("click", function(){
            $(".preview-pane .preview").animate({left: "-375px"}, 300);
            $(".list-view li").removeClass("current");
            return false;
        });

        // setup the view switcher
        $(".main-content > header .view-switcher > h2 > a").click(function(){
            $(this).focus().parent().next().fadeIn();
            return false;
        }).blur(function(){
            $(this).parent().next().fadeOut();
            return false;
        });
', CClientScript::POS_READY); ?>
<?php $this->endContent(); ?>